package com.extrace.loader;

import android.app.Activity;
import android.util.Log;

import com.extrace.net.HttpAsyncTask;
import com.extrace.net.HttpResponseParam;
import com.extrace.ui.main.ExTraceApplication;

public class PackageRouteLoader extends HttpAsyncTask {

    private Activity context;
    String url;

    public PackageRouteLoader(Activity context) {
        super(context);
        this.context = context;
        url = ((ExTraceApplication)context.getApplication()).getDomainServiceUrl();
    }

    @Override
    public void onDataReceive(String class_name, String json_data) {

    }

    @Override
    public void onStatusNotify(HttpResponseParam.RETURN_STATUS status, String str_response) {
        Log.i("onStatusNotify", "onStatusNotify: " + str_response);
    }

    public void SaveRoute(double x, double y) {
        int uid = ((ExTraceApplication)context.getApplication()).getLoginUser().getUID();
        url += "savePackageRoute/uid/" + uid + "/x/" + x + "/y/" + y + "?_type=json";
        try {
            execute(url, "GET");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    protected void onPreExecute() {

    }
}
